package com.sudichina.sudichina.view.activity.wallet;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.sudichina.sudichina.R;
import com.sudichina.sudichina.view.activity.main.BaseActivity;
import com.sudichina.sudichina.view.activity.wallet.payui.OnPasswordInputFinish;
import com.sudichina.sudichina.view.activity.wallet.payui.PayPopWindow;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.sudichina.sudichina.view.activity.login.LoginActivity.context;

/**
 * Created by ${杨伟乔} on 2017/3/10.
 * 邮箱: yangweiqiao@126.com
 * QQ: 463217558
 * 别人光鲜的背后或者有着太多不为人知的痛苦
 * 学习可以改变一切、 行动可以解决一切问题、
 */
//提现界面
public class WithdrawActivity extends BaseActivity {

    @BindView(R.id.iv_back)
    ImageView privateIvBack;
    @BindView(R.id.tv_title)
    TextView privateTvTitle;
    @BindView(R.id.tv_right)
    TextView privateTvRight;
    @BindView(R.id.et_withdraw_money)
    EditText privateEtWithdrawMoney;
    @BindView(R.id.tv_balance_money)
    TextView privateTvBalanceMoney;
    @BindView(R.id.tv_withdraw_all)
    TextView privateTvWithdrawAll;
    @BindView(R.id.iv_bank_img)
    ImageView privateIvBankImg;
    @BindView(R.id.tv_bank_card)
    TextView privateTvBankCard;
    @BindView(R.id.lv_had_card)
    LinearLayout privateLvHadCard;
    @BindView(R.id.confirm_withdraw_tv)
    TextView privateConfirmWithdrawTv;
    @BindView(R.id.tv_no_card)
    TextView privateTvNoCard;
    View view;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_withdraw);
        ButterKnife.bind(this);
        privateTvTitle.setText("提现");
          view = findViewById(R.id.home_background);

    }
    PayPopWindow   popWindow;
    @OnClick({R.id.iv_back, R.id.tv_withdraw_all, R.id.confirm_withdraw_tv, R.id.tv_no_card})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.iv_back:
                finish();
                break;
            case R.id.tv_withdraw_all:
                break;
            case R.id.confirm_withdraw_tv:
                /**
                 * 点击确认提现
                 */
                //弹出popupwindow
                    popWindow = new PayPopWindow(WithdrawActivity.this,view);
                popWindow.showAsDropDown(view);
                popWindow.setOnFinishInput(new OnPasswordInputFinish() {
                    @Override
                    public void inputFinish() {
//                        Toast.makeText(context, popWindow.getStrPassword(), Toast.LENGTH_SHORT).show();
                        // TODO: 2017/3/11 这个地方效验密码的正确性 
                        
                        //密码正确 提示用户申请提现成功
                        //密码错误  提示用户的交易密码错误 弹框 重试 或者是忘记密码
                        popWindow.StartAnima();
                    }
                });


                break;
            case R.id.tv_no_card:
                break;
        }
    }
}
